#{extends 'main.html' /}

#{set 'moreStyles'}
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/Users/common.scss'}" />
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/Users/edit.scss'}" />
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/navigationbar.scss'}" />
#{get 'moreStyles' /}
#{/set}

<script language="javascript">
$(function(){
	var validateResult = "#{error 'validateRestle'/}";
	if(validateResult == "SUCC") {
		alert("用户资料修改成功。");
	}
});
</script>

<div id="users-menu">
</div>

<div class="users-content">
		<div id="edit-comment">
		${error}
		<table>
			#{form @users.commitRegisterInfo(), name:'form1', is:'form1'}
			<tr>
				<td class="left">用户名：</td>
				<td class="right">
					<input type="text" name="user.username" value="${user?.username}">
					<font class="red">*</font>&nbsp;
					<span class="error">#{error 'user.username' /}</span>
				</td>
			</tr>
			<tr>
				<td class="left">密码：</td>
				<td class="right">
					<input type="password" name="user.password" value="${user?.password}">
					<font class="red">*</font>&nbsp;
					<span class="error">#{error 'user.password' /}</span>
				</td>
			</tr>
			<tr>
				<td class="left">密码提示问题：</td>
				<td class="right">
					<input type="text" name="user.question" value="${user?.question}">
					<font class="red">*</font>&nbsp;
					<span class="error">#{error 'user.question' /}</span>
				</td>
			</tr>
			<tr>
				<td class="left">密码提示答案：</td>
				<td class="right">
					<input type="text" name="user.answer" value="${user?.answer}">
					<font class="red">*</font>&nbsp;
					<span class="error">#{error 'user.answer' /}</span>
				</td>
			</tr>
			<tr>
				<td class="left">真实姓名：</td>
				<td class="right">
					<input type="text" name="user.realname" value="${user?.realname}">
					<span class="error">#{error 'user.realname' /}</span>
				</td>
			</tr>
			<tr>
				<td class="left">性别：</td>
				<td class="right">
					<select name="user.sex" style= "width:100px ">
						<option value="M">男</option>
						<option value="F">女</option>
					</select>
				</td>
			</tr>
			<tr>
				<td class="left">生日：</td>
				<td class="right">
					<input type="text" name="user.birthday" value="${user?.birthday}">
					<span class="error">#{error 'user.birthday' /}</span>
				</td>
			</tr>
			<tr>
				<td class="left">省：</td>
				<td class="right">
					<input type="text" name="user.province" value="${user?.province}">
					<span class="error">#{error 'user.province' /}</span>
				</td>
			</tr>
			<tr>
				<td class="left">市：</td>
				<td class="right">
					<input type="text" name="user.city" value="${user?.city}">
					<span class="error">#{error 'user.city' /}</span>
				</td>
			</tr>
			<tr>
				<td class="left">销售模式：</td>
				<td class="right">
				<input type="text" name="user.salesmode" value="${user?.salesmode}">
				<span class="error">#{error 'user.salesmode' /}</span>
				</td>
			</tr>
			<tr>
				<td class="left">详细收货地址：</td>
				<td class="right">
				<input type="text" name="user.deliveryAddress" value="${user?.deliveryAddress}">
				<span class="error">#{error 'user.deliveryAddress' /}</span>
				</td>
			</tr>
			<tr>
				<td class="left">邮政编码：</td>
				<td class="right">
				<input type="text" name="user.zipcode" value="${user?.zipcode}">
				<span class="error">#{error 'user.zipcode' /}</span>
				</td>
			</tr>
			<tr>
				<td class="left">联系电话或手机：</td>
				<td class="right">
				<input type="text" name="user.phoneNo" value="${user?.phoneNo}">
				<span class="error">#{error 'user.phoneNo' /}</span>
				</td>
			</tr>
			<tr>
				<td class="left">QQ：</td>
				<td class="right">
				<input type="text" name="user.qqNo" value="${user?.qqNo}">
				<span class="error">#{error 'user.qqNo' /}</span>
				</td>
			</tr>
			<tr>
				<td class="left">MSN：</td>
				<td class="right">
				<input type="text" name="user.msnNo" value="${user?.msnNo}">
				<span class="error">#{error 'user.msnNo' /}</span>
				</td>
			</tr>
			<tr>
				<td class="left">E-mail：</td>
				<td class="right">
					<input type="text" name="user.email" value="${user?.email}">
					<font class="red">*</font>&nbsp;
					<span class="error">#{error 'user.email' /}</span>
				</td>
			</tr>
			#{/form}
			<tr>
				<td class="left">
					<input class="button" type="image" src="@{'/public/images/btn_submit.jpg'}" value="提交" onclick="postData()">
				</td>
				<td class="right">
					<a href="/users/register"><input class="button" type="image" src="@{'/public/images/btn_reset.jpg'}" value="重置"></a>
				</td>
			</tr>
		</table>
		<script language="javascript">
		function postData() {
			$('form').submit();
		}
		</script>
	</div>
</div>